<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('软件版本更新内容新增及修改')" />
    <style type="text/css">
        .layui-form-item{margin-top: 0px;}
        .layui-form-label {width:120px;;padding-right: 0px;}
        .layui-input-block {margin-left: 150px}
        .layui-form-radio {line-height:32px;margin: 0 0;padding-right: 0;}
    </style>
</head>
<body>
<form class="layui-form" id="form-versionitem-add" style="padding: 5px 30px 10px 30px;">
    <input type="hidden" id="guid" name="guid"  th:value="${versioinItem?.guid}">
    <input type="hidden" id="versionId" name="versionId"  th:value="${versioinItem?.versionId}">
    <div class="layui-form-item" style="margin-top:6px;">
        <label class="layui-form-label"><font class="f_red">*</font>功能名称：</label>
        <div class="layui-input-block">
            <input type="text" name="funcName" id="funcName" th:value="${versioinItem?.funcName}" lay-verify="required" autocomplete="off" placeholder="请输入" class="layui-input" style="width:55%;float:left;"><span style="line-height:35px;margin-left:10px;color: blue;">可填写表/视图/触发器/存储过程等名称</span>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">功能类型：</label>
        <div class="layui-input-block" th:with="funcType=${versionFuncTypes}">
            <span style="margin-right:10px;" th:each="dict1 : ${funcType}">
                <input type="radio" name="funcType"  th:title="${dict1.info}" th:value="${dict1.code}" th:checked="${dict1 == versioinItem.funcType}">
            </span>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">操作类型：</label>
        <div class="layui-input-block" th:with="opType=${versionOperateTypes}">
            <span style="margin-right:10px;" th:each="dict2 : ${opType}">
                <input type="radio" name="operateType"  th:title="${dict2.info}" th:value="${dict2.code}" th:checked="${dict2 == versioinItem.operateType}">
            </span>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">状态：</label>
        <div class="layui-input-block">
            <input type="radio" name="deleted" value="0" title="启用" th:checked="${versioinItem.deleted == false}">
            <span style="margin-left: 10px;"><input type="radio" name="deleted" value="1" title="停用" th:checked="${versioinItem.deleted == true}"></span>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">描述：</label>
        <div class="layui-input-block">
            <input type="hidden" name="describe" id="describe" th:value="${versioinItem?.describe}">
            <textarea id="edit" name="edit" class="layui-textarea"  th:text="${versioinItem?.describe}" placeholder="请输入内容"></textarea>
        </div>
    </div>
</form>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    /*<![CDATA[*/
    var prefix = ctx + "system/versionitem";
    /*]]>*/
</script>
<script type="text/javascript">
    var layedit,index;
    layui.use(['table','form','layer','jquery','layedit'], function () {
        var $ = layui.$,layer = layui.layer,form = layui.form,table = layui.table;
        layedit = layui.layedit;
        index=layedit.build('edit',{
            height:260,
            tool: [
                'strong' //加粗
                ,'italic' //斜体
                ,'underline' //下划线
                ,'del' //删除线
                ,'|' //分割线
                ,'left' //左对齐
                ,'center' //居中对齐
                ,'right' //右对齐
                ,'link' //超链接
                ,'unlink' //清除链接
            ]
        }); //建立编辑器
    });
    function submitHandler() {
        $('#describe').val(layedit.getContent(index));
        if($('#guid').val() == ""){//通过判断guid是否存在来判断是新增还是保存
            if ($.validate.form()) {
                $.operate.save(prefix + "/addpost", $.common.formToJSON('form-versionitem-add'));
            }
        }else{
            if ($.validate.form()) {
                $.operate.save(prefix + "/editpost", $.common.formToJSON('form-versionitem-add'));
            }
        }
    }
</script>
</body>
</html>